import LoaderContainer from '@/pages/workbench/loader';

interface DealPageProps {
    pageType: string,
    code: string,
    pageCode: string,
}

export const DealPage = (props: DealPageProps) => {
    const { pageType, code, pageCode } = props;
    if (!pageType) {
        return <div></div>;
    }
    const pageDetail = pageType.replace(pageType[0], pageType[0].toLowerCase());
    if (LoaderContainer?.[`${pageDetail}DetailInvoice`]) {
        return <div></div>;
    }
    const Comp = LoaderContainer?.[`${pageDetail}DetailInvoice`];
    return <Comp
        code={code}
        pageCode={pageCode}
    />
};

export default DealPage;